home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
netbsd
/
experimental
/
bin10
/
mw-1.0a-941229-diffs
< prev
next >
Wrap
Text File
|
1995-03-31
|
65KB
|
2,297 lines
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/adosglue.h sys/arch/amiga/amiga/adosglue.h
*** sys.orig/arch/amiga/amiga/adosglue.h Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/adosglue.h Thu Dec 22 21:12:39 1994
***************
*** 56,63 ****
#define ADT_NETBSDSWAP 3
#define ADT_NETBSDUSER 4
! #define ADT_AMIX 5
#define ISFSARCH_NETBSD(adt) \
! ((adt).archtype >= ADT_NETBSDROOT && (adt).archtype <= ADT_NETBSDUSER)
#endif /* _ADOSGLUE_H_ */
--- 56,64 ----
#define ADT_NETBSDSWAP 3
#define ADT_NETBSDUSER 4
! #define ADT_NETBSDUSPEC 5
! #define ADT_AMIX 6
#define ISFSARCH_NETBSD(adt) \
! ((adt).archtype >= ADT_NETBSDROOT && (adt).archtype <= ADT_NETBSDUSPEC)
#endif /* _ADOSGLUE_H_ */
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/amiga_init.c sys/arch/amiga/amiga/amiga_init.c
*** sys.orig/arch/amiga/amiga/amiga_init.c Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/amiga_init.c Tue Dec 27 21:41:36 1994
***************
*** 52,55 ****
--- 52,60 ----
/*
+ * these are used by the extended spl?() macros.
+ */
+ volatile unsigned short *amiga_intena_read, *amiga_intena_write;
+
+ /*
* the number of pages in our hw mapping and the start address
*/
***************
*** 647,650 ****
--- 652,662 ----
ciaa.icr = 0x7f; /* and keyboard */
ciab.icr = 0x7f; /* and again */
+
+ /*
+ * remember address of read and write intena register for use
+ * by extended spl?() macros.
+ */
+ amiga_intena_read = &custom.intenar;
+ amiga_intena_write = &custom.intena;
/*
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/autoconf.c sys/arch/amiga/amiga/autoconf.c
*** sys.orig/arch/amiga/amiga/autoconf.c Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/autoconf.c Tue Dec 27 19:41:22 1994
***************
*** 67,70 ****
--- 67,74 ----
custom.intena = INTF_SETCLR | INTF_INTEN;
+
+ /* also enable hardware aided software interrupts */
+ custom.intena = INTF_SETCLR | INTF_SOFTINT;
+
#ifdef GENERIC
if ((boothowto & RB_ASKNAME) == 0)
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/conf.c sys/arch/amiga/amiga/conf.c
*** sys.orig/arch/amiga/amiga/conf.c Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/conf.c Thu Dec 22 21:12:39 1994
***************
*** 513,516 ****
--- 513,534 ----
}
+ #include "tun.h"
+ #define tunioctl tuncioctl
+ cdev_decl(tun);
+ #if NTUN > 0
+ #define cdev_tun_init(c,n) {\
+ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
+ dev_init(c,n,write), dev_init(c,n,ioctl), \
+ (dev_type_stop((*))) enodev, (dev_type_reset((*))) nullop, \
+ 0, dev_init(c,n,select), (dev_type_map((*))) enodev, 0 }
+ #else
+ #define cdev_tun_init(c, n) {\
+ (dev_type_open((*))) enodev, (dev_type_close((*))) enodev, \
+ (dev_type_read((*))) enodev, (dev_type_write((*))) enodev, \
+ (dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
+ (dev_type_reset((*))) nullop, 0, \
+ (dev_type_select((*))) enodev, (dev_type_map((*))) enodev, 0 }
+ #endif
+
#ifdef LKM
***************
*** 580,585 ****
cdev_fd_init(1), /* 21: file descriptor pseudo-dev */
cdev_bpf_init(NBPFILTER), /* 22: berkeley packet filter */
! cdev_notdef(), /* 23: */
! cdev_lkm_init(NLKM), /* 24: loadable kernel modules pdev */
LKM_CDEV(), /* 25: Empty slot for LKM */
LKM_CDEV(), /* 26: Empty slot for LKM */
--- 598,603 ----
cdev_fd_init(1), /* 21: file descriptor pseudo-dev */
cdev_bpf_init(NBPFILTER), /* 22: berkeley packet filter */
! cdev_tun_init(NTUN,tun), /* 23: IP tunnel pseudo-device */
! cdev_lkm_init(NLKM), /* 24: loadable kernel modules pdev */
LKM_CDEV(), /* 25: Empty slot for LKM */
LKM_CDEV(), /* 26: Empty slot for LKM */
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/disksubr.c sys/arch/amiga/amiga/disksubr.c
*** sys.orig/arch/amiga/amiga/disksubr.c Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/disksubr.c Thu Dec 22 21:12:39 1994
***************
*** 154,158 ****
--- 154,167 ----
* I also don't trust rdb->secpercyl
*/
+ #if 0
+ /*
+ * *DONT* pretend to be smarter than the user who configured the
+ * disk!! If the RDB is wrong, fix the RDB, don't propagate problems
+ * instead of fixing them..
+ */
lp->d_secpercyl = min(rbp->secpercyl, lp->d_nsectors * lp->d_ntracks);
+ #else
+ lp->d_secpercyl = rbp->secpercyl;
+ #endif
#ifdef DIAGNOSTIC
if (lp->d_ncylinders != rbp->ncylinders)
***************
*** 259,262 ****
--- 268,289 ----
}
break;
+ case ADT_NETBSDUSPEC:
+ {
+ int idx = (pbp->e.dostype & 0xff) - 'D';
+ if (idx < 0 || idx > 5) {
+ printf("WARN: BSD%c out of bounds! Ignoring.\n", idx+'D');
+ clp->rdblock = RDBNULL; /* invalidate cpulab */
+ continue;
+ }
+ /* skip root, swap and raw partition */
+ idx += 3;
+ pp = &lp->d_partitions[idx];
+ if (pp->p_size) {
+ printf("WARN: more than one %c partition,ignoring\n", idx + 'A');
+ clp->rdblock = RDBNULL; /* invalidate cpulab */
+ continue;
+ }
+ }
+ break;
case ADT_NETBSDUSER:
case ADT_AMIGADOS:
***************
*** 493,496 ****
--- 520,524 ----
return(adt);
case DOST_XXXBSD:
+ #if 0
#ifdef DIAGNOSTIC
printf("found dostype: 0x%x which is deprecated", dostype);
***************
*** 510,513 ****
--- 538,553 ----
#endif
return(getadostype(dostype));
+ #endif /* 0, don't break something very useful */
+ if (b1 == 'R') {
+ adt.archtype = ADT_NETBSDROOT;
+ adt.fstype = FS_BSDFFS;
+ } else if (b1 == 'S') {
+ adt.archtype = ADT_NETBSDSWAP;
+ adt.fstype = FS_SWAP;
+ } else {
+ adt.archtype = ADT_NETBSDUSPEC;
+ adt.fstype = FS_BSDFFS;
+ }
+ return adt;
default:
#ifdef DIAGNOSTIC
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/genassym.c sys/arch/amiga/amiga/genassym.c
*** sys.orig/arch/amiga/amiga/genassym.c Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/genassym.c Tue Dec 27 20:14:28 1994
***************
*** 97,101 ****
printf("#define\tT_TRACE %d\n", T_TRACE);
printf("#define\tT_MMUFLT %d\n", T_MMUFLT);
! printf("#define\tT_SSIR %d\n", T_SSIR);
printf("#define\tT_FMTERR %d\n", T_FMTERR);
printf("#define\tT_COPERR %d\n", T_COPERR);
--- 97,101 ----
printf("#define\tT_TRACE %d\n", T_TRACE);
printf("#define\tT_MMUFLT %d\n", T_MMUFLT);
! /* printf("#define\tT_SSIR %d\n", T_SSIR);*/
printf("#define\tT_FMTERR %d\n", T_FMTERR);
printf("#define\tT_COPERR %d\n", T_COPERR);
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/locore.s sys/arch/amiga/amiga/locore.s
*** sys.orig/arch/amiga/amiga/locore.s Tue Dec 20 09:33:07 1994
--- sys/arch/amiga/amiga/locore.s Wed Dec 28 18:38:49 1994
***************
*** 57,60 ****
--- 57,61 ----
#define INTREQRADDR(ar) movl _INTREQRaddr,ar
#define INTREQWADDR(ar) movl _INTREQWaddr,ar
+ #define INTENAWADDR(ar) movl _amiga_intena_write,a0
.text
***************
*** 510,514 ****
_lev2intr:
_lev3intr:
- _lev4intr:
moveml #0xC0C0,sp@-
Lnotdma:
--- 511,514 ----
***************
*** 526,531 ****
--- 526,558 ----
_lev6intr:
+ /*
+ * cause a level 4 interrupt (AUD3) to occur as soon
+ * as we return. Block generation of level 6 ints until
+ * we have dealt with this one.
+ */
+ movel a0,sp@-
+ INTREQWADDR(a0)
+ movew #INTF_SETCLR+INTF_AUD3,a0@
+ INTENAWADDR(a0)
+ movew #INTF_EXTER,a0@
+ movew #INTF_SETCLR+INTF_AUD3,a0@ | make sure THIS one is ok...
+ movel sp@+,a0
+ rte
+
+ _lev4intr:
+ _fake_lev6intr:
moveml #0xC0C0,sp@-
+ /*
+ * check for fake level 6
+ */
+ INTREQRADDR(a0)
+ movew a0@,d0
+ btst #INTB_EXTER,d0
+ beq Lnotdma | if regular level 4, handle normally
+
#if NZSSC > 0
+ /*
+ * THIS WILL ALSO HAVE TO CLEAR INTF_AUD3 !!! Mike please fix...
+ */
jbsr _siopintr6 | check for siop (53C710) interrupt
tstl d0
***************
*** 535,539 ****
movb a0@(CIAICR),d0 | read irc register (clears ints!)
INTREQWADDR(a0)
! movew #INTF_EXTER,a0@ | clear EXTER interrupt in intreq
btst #0,d0 | timerA interrupt?
jeq Lskipciab | no
--- 562,568 ----
movb a0@(CIAICR),d0 | read irc register (clears ints!)
INTREQWADDR(a0)
! movew #INTF_EXTER+INTF_AUD3,a0@ | clear EXTER | AUD3 in intreq
! INTENAWADDR(a0)
! movew #INTF_SETCLR+INTF_EXTER,a0@ | reenable EXTER interrupts
btst #0,d0 | timerA interrupt?
jeq Lskipciab | no
***************
*** 574,578 ****
* for bus error frames (type 10 and 11).
*/
- .comm _ssir,1
.globl _astpending
.globl rei
--- 603,606 ----
***************
*** 583,590 ****
#endif
tstl _astpending | AST pending?
! jeq Lchksir | no, go check for SIR
Lrei1:
btst #5,sp@ | yes, are we returning to user mode?
! jne Lchksir | no, go check for SIR
movw #PSL_LOWIPL,sr | lower SPL
clrl sp@- | stack adjust
--- 611,618 ----
#endif
tstl _astpending | AST pending?
! jeq Ldorte | no, done
Lrei1:
btst #5,sp@ | yes, are we returning to user mode?
! jne Ldorte | no, done
movw #PSL_LOWIPL,sr | lower SPL
clrl sp@- | stack adjust
***************
*** 614,646 ****
moveml sp@+,#0x7FFF | restore user registers
movl sp@,sp | and our SP
- rte | and do real RTE
- Lchksir:
- tstb _ssir | SIR pending?
- jeq Ldorte | no, all done
- movl d0,sp@- | need a scratch register
- movw sp@(4),d0 | get SR
- andw #PSL_IPL7,d0 | mask all but IPL
- jne Lnosir | came from interrupt, no can do
- movl sp@+,d0 | restore scratch register
- Lgotsir:
- movw #SPL1,sr | prevent others from servicing int
- tstb _ssir | too late?
- jeq Ldorte | yes, oh well...
- clrl sp@- | stack adjust
- moveml #0xFFFF,sp@- | save all registers
- movl usp,a1 | including
- movl a1,sp@(FR_SP) | the users SP
- clrl sp@- | VA == none
- clrl sp@- | code == none
- movl #T_SSIR,sp@- | type == software interrupt
- jbsr _trap | go handle it
- lea sp@(12),sp | pop value args
- movl sp@(FR_SP),a0 | restore
- movl a0,usp | user SP
- moveml sp@+,#0x7FFF | and all remaining registers
- addql #8,sp | pop SP and stack adjust
- rte
- Lnosir:
- movl sp@+,d0 | restore scratch register
Ldorte:
rte | real return
--- 642,645 ----
***************
*** 1681,1704 ****
ploadw #1,a0@ | pre-load translation
Lploadw040: | should 68040 do a ptest?
- rts
-
- /*
- * Set processor priority level calls. Most are implemented with
- * inline asm expansions. However, spl0 requires special handling
- * as we need to check for our emulated software interrupts.
- */
-
- ENTRY(spl0)
- moveq #0,d0
- movw sr,d0 | get old SR for return
- movw #PSL_LOWIPL,sr | restore new SR
- tstb _ssir | software interrupt pending?
- jeq Lspldone | no, all done
- subql #4,sp | make room for RTE frame
- movl sp@(4),sp@(2) | position return address
- clrw sp@(6) | set frame type 0
- movw #PSL_LOWIPL,sp@ | and new SR
- jra Lgotsir | go handle it
- Lspldone:
rts
--- 1680,1683 ----
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/machdep.c sys/arch/amiga/amiga/machdep.c
*** sys.orig/arch/amiga/amiga/machdep.c Tue Dec 20 09:33:08 1994
--- sys/arch/amiga/amiga/machdep.c Wed Dec 28 23:04:22 1994
***************
*** 136,139 ****
--- 136,145 ----
int physmem = MAXMEM; /* max supported memory, changes to actual */
/*
+ * extender "register" for software interrupts. Moved here
+ * from locore.s, since softints are no longer dealt with
+ * in locore.s.
+ */
+ unsigned char ssir;
+ /*
* safepri is a safe priority for sleep to set for a spin-wait
* during autoconfiguration or after a panic.
***************
*** 1060,1064 ****
if ((howto&RB_NOSYNC) == 0)
bootsync();
! splhigh(); /* extreme priority */
if (howto&RB_HALT) {
printf("halted\n\n");
--- 1066,1070 ----
if ((howto&RB_NOSYNC) == 0)
bootsync();
! spl7(); /* extreme priority */
if (howto&RB_HALT) {
printf("halted\n\n");
***************
*** 1299,1311 ****
/*
- * make sure we have software ints enabled at all..
- */
- custom.intena = INTF_SETCLR | INTF_SOFTINT;
-
- /*
* and cause a software interrupt (spl1). This interrupt might
* happen immediately, or after returning to a safe enough level.
*/
! custom.intreq = INTF_SETCLR | INTF_SOFTINT;
}
--- 1305,1312 ----
/*
* and cause a software interrupt (spl1). This interrupt might
* happen immediately, or after returning to a safe enough level.
*/
! setsoftcback();
}
***************
*** 1384,1394 ****
/*
* first clear the softint-bit
! * then call installed callbacks,
* this order is dicated by the nature of
* software interrupts. The other order
* allows software interrupts to be missed
*/
! custom.intreq = INTF_SOFTINT;
! call_sicallbacks();
}
break;
--- 1385,1410 ----
/*
* first clear the softint-bit
! * then process all classes of softints.
* this order is dicated by the nature of
* software interrupts. The other order
* allows software interrupts to be missed
*/
! clrsoftint();
! if (ssir & SIR_NET) {
! siroff(SIR_NET);
! cnt.v_soft++;
! netintr();
! }
! if (ssir & SIR_CLOCK) {
! siroff(SIR_CLOCK);
! cnt.v_soft++;
! /* XXXX softclock(&frame.f_stackadj); */
! softclock();
! }
! if (ssir & SIR_CBACK) {
! siroff(SIR_CBACK);
! cnt.v_soft++;
! call_sicallbacks();
! }
}
break;
***************
*** 1454,1462 ****
case 3:
/* VBL */
! if (custom.intreqr& INTF_BLIT)
blitter_handler();
! if (custom.intreqr & INTF_COPER)
copper_handler();
! if (custom.intreqr & INTF_VERTB)
vbl_handler();
break;
--- 1470,1478 ----
case 3:
/* VBL */
! if (ireq & INTF_BLIT)
blitter_handler();
! if (ireq & INTF_COPER)
copper_handler();
! if (ireq & INTF_VERTB)
vbl_handler();
break;
***************
*** 1547,1551 ****
if (doingdump)
return;
! s = splhigh();
doingdump = 1;
printf("pid = %d, pc = %s, ", curproc->p_pid, hexstr(fp->f_pc, 8));
--- 1563,1567 ----
if (doingdump)
return;
! s = spl7();
doingdump = 1;
printf("pid = %d, pc = %s, ", curproc->p_pid, hexstr(fp->f_pc, 8));
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/swapgeneric.c sys/arch/amiga/amiga/swapgeneric.c
*** sys.orig/arch/amiga/amiga/swapgeneric.c Tue Dec 20 09:33:08 1994
--- sys/arch/amiga/amiga/swapgeneric.c Sun Dec 25 03:49:38 1994
***************
*** 125,128 ****
--- 125,134 ----
}
cp = bp + 2;
+ if (cp[1] && (cp[1] < 'a' || cp[1] > 'h'))
+ {
+ printf ("bad partition, valid are %sa to %sh\n",
+ gc->gc_driver->cd_name, gc->gc_driver->cd_name);
+ continue;
+ }
if (*cp >= '0' && *cp <= '9')
break;
***************
*** 138,142 ****
struct genericconf *gc;
struct bdevsw *bdp;
! int unit, swaponroot;
char name[128];
char *cp;
--- 144,148 ----
struct genericconf *gc;
struct bdevsw *bdp;
! int unit, part, swaponroot;
char name[128];
char *cp;
***************
*** 148,151 ****
--- 154,158 ----
unit = 0;
+ part = 0;
if (boothowto & RB_ASKNAME) {
gc = getgenconf(name);
***************
*** 153,156 ****
--- 160,165 ----
while (*cp >= '0' && *cp <= '9')
unit = 10 * unit + *cp++ - '0';
+ if (*cp >= 'a' && *cp <= 'h')
+ part = *cp++ - 'a';
if (*cp == '*')
swaponroot = 1;
***************
*** 191,195 ****
found:
! gc->gc_root = MAKEDISKDEV(major(gc->gc_root), unit, 0);
rootdev = gc->gc_root;
--- 200,204 ----
found:
! gc->gc_root = MAKEDISKDEV(major(gc->gc_root), unit, part);
rootdev = gc->gc_root;
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/amiga/trap.c sys/arch/amiga/amiga/trap.c
*** sys.orig/arch/amiga/amiga/trap.c Tue Dec 20 09:33:08 1994
--- sys/arch/amiga/amiga/trap.c Tue Dec 27 19:31:46 1994
***************
*** 617,653 ****
case T_ASTFLT|T_USER:
astpending = 0;
- /*
- * We check for software interrupts first. This is because
- * they are at a higher level than ASTs, and on a VAX would
- * interrupt the AST. We assume that if we are processing
- * an AST that we must be at IPL0 so we don't bother to
- * check. Note that we ensure that we are at least at SIR
- * IPL while processing the SIR.
- */
- spl1();
- /*FALLTHROUGH*/
- /*
- * Software interrupt
- */
- case T_SSIR:
- case T_SSIR|T_USER:
- if (ssir & SIR_NET) {
- siroff(SIR_NET);
- cnt.v_soft++;
- netintr();
- }
- if (ssir & SIR_CLOCK) {
- siroff(SIR_CLOCK);
- cnt.v_soft++;
- /* XXXX softclock(&frame.f_stackadj); */
- softclock();
- }
- /*
- * If this was not an AST trap, we are all done.
- */
- if (type != (T_ASTFLT|T_USER)) {
- cnt.v_trap--;
- return;
- }
spl0();
if (p->p_flag & P_OWEUPC) {
--- 617,620 ----
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/conf/Makefile.amiga sys/arch/amiga/conf/Makefile.amiga
*** sys.orig/arch/amiga/conf/Makefile.amiga Tue Dec 20 09:33:15 1994
--- sys/arch/amiga/conf/Makefile.amiga Tue Dec 27 15:24:51 1994
***************
*** 35,39 ****
INCLUDES= -I. -I$S/arch -I$S -I$S/sys
! COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Damiga
CFLAGS= -O -mc68020 -m68881 ${COPTS}
--- 35,39 ----
INCLUDES= -I. -I$S/arch -I$S -I$S/sys
! COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Damiga -Dm68k
CFLAGS= -O -mc68020 -m68881 ${COPTS}
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf.c sys/arch/amiga/dev/grf.c
*** sys.orig/arch/amiga/dev/grf.c Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/grf.c Sun Dec 25 09:08:11 1994
***************
*** 253,257 ****
case GRFSETVMODE:
error = gp->g_mode(gp, GM_GRFSETVMODE, data);
! if (error == 0 && gp->g_itedev)
ite_reinit(gp->g_itedev);
break;
--- 253,257 ----
case GRFSETVMODE:
error = gp->g_mode(gp, GM_GRFSETVMODE, data);
! if (error == 0 && gp->g_itedev && !(gp->g_flags & GF_GRFON))
ite_reinit(gp->g_itedev);
break;
***************
*** 269,272 ****
--- 269,273 ----
case GRFIOCGSPRITEINF:
case GRFIOCGSPRITEMAX:
+ case GRFIOCBITBLT:
return(gp->g_mode(gp, GM_GRFIOCTL, cmd, data));
default:
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rh.c sys/arch/amiga/dev/grf_rh.c
*** sys.orig/arch/amiga/dev/grf_rh.c Tue Dec 20 09:33:17 1994
--- sys/arch/amiga/dev/grf_rh.c Sun Dec 25 09:27:02 1994
***************
*** 21,24 ****
--- 21,26 ----
#include <amiga/dev/zthreebusvar.h>
+ enum mode_type { MT_TXTONLY, MT_GFXONLY, MT_BOTH };
+
int rh_mondefok __P((struct MonDef *));
***************
*** 26,30 ****
int rh_load_mon __P((struct grf_softc *gp, struct MonDef *md));
int rh_getvmode __P((struct grf_softc *gp, struct grfvideo_mode *vm));
! int rh_setvmode __P((struct grf_softc *gp, unsigned int mode, int txtonly));
--- 28,33 ----
int rh_load_mon __P((struct grf_softc *gp, struct MonDef *md));
int rh_getvmode __P((struct grf_softc *gp, struct grfvideo_mode *vm));
! int rh_setvmode __P((struct grf_softc *gp, unsigned int mode,
! enum mode_type type));
***************
*** 38,41 ****
--- 41,54 ----
#endif
+ /* make it patchable, and settable by kernel config option */
+ #ifndef RH_MEMCLK
+ #define RH_MEMCLK 61000000 /* this is the memory clock value, you shouldn't
+ set it to less than 61000000, higher values may
+ speed up blits a little bit, if you raise this
+ value too much, some trash will appear on your
+ screen. */
+ #endif
+ int rh_memclk = RH_MEMCLK;
+
/*
***************
*** 74,77 ****
--- 87,92 ----
#define MDF_CLKDIV2 4
+ /* set this as an option in your kernel config file! */
+ /* #define RZ3_64BIT_SPRITE */
/* -------------- START OF CODE -------------- */
***************
*** 124,128 ****
--- 139,147 ----
const unsigned long *s = data;
struct MonDef *MonitorDef = (struct MonDef *) gp->g_data;
+ #ifdef RZ3_64BIT_SPRITE
short x = (HWC_MEM_SIZE / (4*4)) - 1;
+ #else
+ short x = (HWC_MEM_SIZE / (4*4*2)) - 1;
+ #endif
/* copy only, if there is a data pointer. */
if (data) do {
***************
*** 135,142 ****
WSeq(ba, SEQ_ID_CURSOR_COLOR1, col1);
WSeq(ba, SEQ_ID_CURSOR_COLOR0, col2);
! if (MonitorDef->DEP < 16)
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x85);
! else
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xa5);
WSeq(ba, SEQ_ID_CURSOR_X_LOC_HI, 0x00);
WSeq(ba, SEQ_ID_CURSOR_X_LOC_LO, 0x00);
--- 154,178 ----
WSeq(ba, SEQ_ID_CURSOR_COLOR1, col1);
WSeq(ba, SEQ_ID_CURSOR_COLOR0, col2);
! if (MonitorDef->DEP <= 8) {
! #ifdef RZ3_64BIT_SPRITE
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x85);
! #else
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x03);
! #endif
! }
! else if (MonitorDef->DEP <= 16) {
! #ifdef RZ3_64BIT_SPRITE
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xa5);
! #else
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x23);
! #endif
! }
! else {
! #ifdef RZ3_64BIT_SPRITE
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0xc5);
! #else
! WSeq(ba, SEQ_ID_CURSOR_CONTROL, 0x43);
! #endif
! }
WSeq(ba, SEQ_ID_CURSOR_X_LOC_HI, 0x00);
WSeq(ba, SEQ_ID_CURSOR_X_LOC_LO, 0x00);
***************
*** 391,394 ****
--- 427,515 ----
}
+ void
+ RZ3BitBlit24 (gp, gbb)
+ struct grf_softc *gp;
+ struct grf_bitblt * gbb;
+ {
+ volatile unsigned char *ba = gp->g_regkva;
+ volatile unsigned char *lm = ba + LM_OFFSET;
+ volatile unsigned long * acm = (unsigned long *) (ba + ACM_OFFSET);
+ const struct MonDef * md = (struct MonDef *) gp->g_data;
+ unsigned short mod;
+
+
+ {
+ unsigned long * pt = (unsigned long *) (lm + PAT_MEM_OFF);
+ unsigned long tmp = gbb->mask | ((unsigned long)gbb->mask << 16);
+ *pt++ = tmp;
+ *pt++ = tmp;
+ *pt++ = tmp;
+ *pt++ = tmp;
+ *pt++ = tmp;
+ *pt = tmp;
+ }
+
+ {
+
+ unsigned long tmp = optab[ gbb->op ] << 8;
+ *(acm + ACM_RASTEROP_ROTATION/4) = tmp;
+ }
+
+ mod = 0xc0c2;
+
+ {
+ unsigned long pat = 8 * PAT_MEM_OFF;
+ unsigned long dst = 8 * 3 * (gbb->dst_x + gbb->dst_y * md->TX);
+
+ if (optabs[gbb->op]) {
+ unsigned long src = 8 * 3 * (gbb->src_x + gbb->src_y * md->TX);
+
+ if (gbb->dst_x > gbb->src_x ) {
+ mod &= ~0x8000;
+ src += 8 * 3 * (gbb->w);
+ dst += 8 * 3 * (gbb->w);
+ pat += 8 * 3 * 2;
+ }
+ if (gbb->dst_y > gbb->src_y) {
+ mod &= ~0x4000;
+ src += 8 * 3 * (gbb->h - 1) * md->TX;
+ dst += 8 * 3 * (gbb->h - 1) * md->TX;
+ pat += 8 * 4 * 3;
+ }
+
+ M2I(src);
+ *(acm + ACM_SOURCE/4) = src;
+ }
+
+
+ M2I(pat);
+ *(acm + ACM_PATTERN/4) = pat;
+
+
+ M2I(dst);
+ *(acm + ACM_DESTINATION/4) = dst;
+ }
+ {
+
+ unsigned long tmp = mod << 16;
+ *(acm + ACM_CONTROL/4) = tmp;
+ }
+ {
+
+ unsigned long tmp = gbb->w | (gbb->h << 16);
+ M2I(tmp);
+ *(acm + ACM_BITMAP_DIMENSION/4) = tmp;
+ }
+
+
+ *(((volatile unsigned char *)acm) + ACM_START_STATUS) = 0x00;
+ *(((volatile unsigned char *)acm) + ACM_START_STATUS) = 0x01;
+
+ while ( (*(((volatile unsigned char *)acm)
+ + (ACM_START_STATUS+ 2)) & 1) == 0 ) {};
+
+ }
+
+
void
RZ3SetCursorPos (gp, pos)
***************
*** 465,489 ****
! if (md->DEP > 8)
! xoff *= 2;
vgar(ba, ACT_ADDRESS_RESET);
WAttr(ba, ACT_ID_HOR_PEL_PANNING, (unsigned char)((xoff << 1) & 0x07));
/* have the color lookup function normally again */
vgaw(ba, ACT_ADDRESS_W, 0x20);
! if (md->DEP == 8)
! off = ((yoff * md->TX)/ 4) + (xoff >> 2);
! else
! off = ((yoff * md->TX * 2)/ 4) + (xoff >> 2);
!
! WCrt(ba, CRT_ID_START_ADDR_LOW, ((unsigned char)off));
!
off >>= 8;
-
WCrt(ba, CRT_ID_START_ADDR_HIGH, ((unsigned char)off));
-
off >>= 8;
-
WCrt(ba, CRT_ID_EXT_START_ADDR,
((RCrt(ba, CRT_ID_EXT_START_ADDR) & 0xf0) | (off & 0x0f)));
--- 586,608 ----
! if (md->DEP > 8 && md->DEP <= 16) xoff *= 2;
! else if (md->DEP > 16) xoff *= 3;
vgar(ba, ACT_ADDRESS_RESET);
WAttr(ba, ACT_ID_HOR_PEL_PANNING, (unsigned char)((xoff << 1) & 0x07));
+
/* have the color lookup function normally again */
vgaw(ba, ACT_ADDRESS_W, 0x20);
! if (md->DEP == 8)
! off = ((yoff * md->TX)/ 4) + (xoff >> 2);
! else if (md->DEP == 16)
! off = ((yoff * md->TX * 2)/ 4) + (xoff >> 2);
! else
! off = ((yoff * md->TX * 3)/ 4) + (xoff >> 2);
! WCrt(ba, CRT_ID_START_ADDR_LOW, ((unsigned char)off));
off >>= 8;
WCrt(ba, CRT_ID_START_ADDR_HIGH, ((unsigned char)off));
off >>= 8;
WCrt(ba, CRT_ID_EXT_START_ADDR,
((RCrt(ba, CRT_ID_EXT_START_ADDR) & 0xf0) | (off & 0x0f)));
***************
*** 583,586 ****
--- 702,706 ----
case 8:
case 16:
+ case 24:
return(1);
case 4:
***************
*** 685,694 ****
}
! if (md->DEP == 4)
! HDE = (md->MW+md->FX-1)/md->FX;
! else if (md->DEP == 8)
! HDE = (md->MW+3)/4;
! else if (md->DEP == 16)
! HDE = (md->MW*2+3)/4;
VDE = md->MH-1;
--- 805,812 ----
}
! if (md->DEP == 4) HDE = (md->MW+md->FX-1)/md->FX;
! else if (md->DEP == 8) HDE = (md->MW+3)/4;
! else if (md->DEP == 16) HDE = (md->MW*2+3)/4;
! else if (md->DEP == 24) HDE = (md->MW*3+3)/4;
VDE = md->MH-1;
***************
*** 722,732 ****
if (md->DEP == 4) {
/* 8bit pixel, no gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x00);
! } else if (md->DEP == 8) {
/* 8bit pixel, gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x01);
! } else if (md->DEP == 16) {
/* 16bit pixel, gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x11);
}
WSeq(ba, SEQ_ID_BUS_WIDTH_FEEDB, 0x04);
--- 840,856 ----
if (md->DEP == 4) {
/* 8bit pixel, no gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x00);
! }
! else if (md->DEP == 8) {
/* 8bit pixel, gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x01);
! }
! else if (md->DEP == 16) {
/* 16bit pixel, gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x11);
! }
! else if (md->DEP == 24) {
! /* 24bit pixel, gfx byte path */
! WSeq(ba, SEQ_ID_EXT_PIXEL_CNTL, 0x21);
}
WSeq(ba, SEQ_ID_BUS_WIDTH_FEEDB, 0x04);
***************
*** 801,810 ****
WCrt(ba, CRT_ID_VER_DISP_ENA_END, VDE & 0xff);
! if (md->DEP == 4)
! WCrt(ba, CRT_ID_OFFSET, (HDE / 2) & 0xff);
! else if (md->DEP == 8)
! WCrt(ba, CRT_ID_OFFSET, (md->TX / 8) & 0xff);
! else
! WCrt(ba, CRT_ID_OFFSET, (md->TX / 4) & 0xff);
WCrt(ba, CRT_ID_UNDERLINE_LOC, (md->FY-1) & 0x1f);
--- 925,939 ----
WCrt(ba, CRT_ID_VER_DISP_ENA_END, VDE & 0xff);
! if (md->DEP == 4) {
! WCrt(ba, CRT_ID_OFFSET, (HDE / 2) & 0xff );
! }
! /* all gfx-modes are in byte-mode, means values are multiplied by 8 */
! else if (md->DEP == 8) {
! WCrt(ba, CRT_ID_OFFSET, (md->TX / 8) & 0xff );
! } else if (md->DEP == 16) {
! WCrt(ba, CRT_ID_OFFSET, (md->TX / 4) & 0xff );
! } else {
! WCrt(ba, CRT_ID_OFFSET, (md->TX * 3 / 8) & 0xff );
! }
WCrt(ba, CRT_ID_UNDERLINE_LOC, (md->FY-1) & 0x1f);
***************
*** 822,834 ****
((md->HSS & 0x100) / 0x100 * 8));
! if (md->DEP == 4)
! WCrt(ba, CRT_ID_EXT_START_ADDR,
! (((HDE / 2) & 0x100)/0x100 * 16));
! else if (md->DEP == 8)
! WCrt(ba, CRT_ID_EXT_START_ADDR,
! (((md->TX / 8) & 0x100)/0x100 * 16));
! else
! WCrt(ba, CRT_ID_EXT_START_ADDR,
! (((md->TX / 4) & 0x100)/0x100 * 16));
WCrt(ba, CRT_ID_EXT_HOR_TIMING2,
--- 951,964 ----
((md->HSS & 0x100) / 0x100 * 8));
! if (md->DEP == 4) {
! WCrt(ba, CRT_ID_EXT_START_ADDR, (((HDE / 2) & 0x100)/0x100 * 16));
! }
! else if (md->DEP == 8) {
! WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX / 8) & 0x100)/0x100 * 16));
! } else if (md->DEP == 16) {
! WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX / 4) & 0x100)/0x100 * 16));
! } else {
! WCrt(ba, CRT_ID_EXT_START_ADDR, (((md->TX * 3 / 8) & 0x100)/0x100 * 16));
! }
WCrt(ba, CRT_ID_EXT_HOR_TIMING2,
***************
*** 853,857 ****
unsigned short tmp = CompFQ(md->FQ);
WPLL(ba, 2 , tmp);
! tmp = CompFQ(MEMCLK);
WPLL(ba,10 , tmp);
WPLL(ba,14 , 0x22);
--- 983,987 ----
unsigned short tmp = CompFQ(md->FQ);
WPLL(ba, 2 , tmp);
! tmp = CompFQ(rh_memclk);
WPLL(ba,10 , tmp);
WPLL(ba,14 , 0x22);
***************
*** 904,913 ****
vgaw(ba, VDAC_MASK, 0xff);
! if (md->DEP < 16)
! /* well... probably the PLL chip */
! vgaw(ba, 0x83c6, ((0 & 7) << 5));
! else if (md->DEP == 16)
/* well... */
! vgaw(ba, 0x83c6, ((3 & 7) << 5));
vgaw(ba, VDAC_ADDRESS_W, 0x00);
--- 1034,1049 ----
vgaw(ba, VDAC_MASK, 0xff);
! /* probably some PLL timing stuff here. The value
! for 24bit was found by trial&error :-) */
! if (md->DEP < 16) {
! vgaw(ba, 0x83c6, ((0 & 7) << 5) );
! }
! else if (md->DEP == 16) {
/* well... */
! vgaw(ba, 0x83c6, ((3 & 7) << 5) );
! }
! else if (md->DEP == 24) {
! vgaw(ba, 0x83c6, 0xe0);
! }
vgaw(ba, VDAC_ADDRESS_W, 0x00);
***************
*** 1014,1017 ****
--- 1150,1169 ----
return(1);
+ } else if (md->DEP == 24) {
+ struct grf_bitblt bb = {
+ GRFBBOPset,
+ 0, 0,
+ 0, 0,
+ md->TX, md->TY,
+ 0x0000
+ };
+ WSeq(ba, SEQ_ID_MAP_MASK, 0x0f );
+
+ RZ3BitBlit24(gp, &bb );
+
+ xpan = 0;
+ ypan = 0;
+
+ return 1;
} else
return(0);
***************
*** 1068,1145 ****
* Depth, PAL, TX, TY, XY,FontX, FontY, FontData, FLo, Fhi
*/
static struct MonDef monitor_defs[] = {
/* Text-mode definitions */
/* horizontal 31.5 kHz */
- #ifdef KFONT_8X11
- { 50000000, 28, 640, 506, 81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
- 4, RZ3StdPalette, 80, 46, 3680, 8, 11, kernel_font_8x11, 32, 255},
- #else
{ 50000000, 28, 640, 512, 81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
! 4, RZ3StdPalette, 80, 64, 5120, 8, 8, kernel_font_8x8, 32, 255},
! #endif
/* horizontal 38kHz */
- #ifdef KFONT_8X11
- { 75000000, 28, 768, 594, 97, 99,107,120,117, 601, 615, 625, 638, 638,
- 4, RZ3StdPalette, 96, 54, 5184, 8, 11, kernel_font_8x11, 32, 255},
- #else
{ 75000000, 28, 768, 600, 97, 99,107,120,117, 601, 615, 625, 638, 638,
! 4, RZ3StdPalette, 96, 75, 7200, 8, 8, kernel_font_8x8, 32, 255},
! #endif
/* horizontal 64kHz */
- #ifdef KFONT_8X11
- { 50000000, 24, 768, 594, 97,104,112,122,119, 601, 606, 616, 628, 628,
- 4, RZ3StdPalette, 96, 54, 5184, 8, 8, kernel_font_8x8, 32, 255},
- #else
{ 50000000, 24, 768, 600, 97,104,112,122,119, 601, 606, 616, 628, 628,
! 4, RZ3StdPalette, 96, 75, 7200, 8, 8, kernel_font_8x8, 32, 255},
! #endif
/* 8-bit gfx-mode definitions */
! /*
! * IMPORTANT: the "logical" screen size can be up to 2048x2048 pixels,
! * independent from the "physical" screen size. If your code does NOT
! * support panning, please adjust the "logical" screen sizes below to
! * match the physical ones
! */
/* 640 x 480, 8 Bit, 31862 Hz, 63 Hz */
{ 26000000, 0, 640, 480, 161,175,188,200,199, 481, 483, 491, 502, 502,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* This is the logical ^ ^ screen size */
/* 640 x 480, 8 Bit, 38366 Hz, 76 Hz */
{ 31000000, 0, 640, 480, 161,169,182,198,197, 481, 482, 490, 502, 502,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
- /* 800 x 600, 8 Bit, 31620 Hz, 50 Hz (1950) */
- { 32000000, 0, 800, 600, 201,202,218,249,248, 601, 602, 612, 628, 628,
- 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 800 x 600, 8 Bit, 38537 Hz, 61 Hz */
{ 39000000, 0, 800, 600, 201,211,227,249,248, 601, 603, 613, 628, 628,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 1024 x 768, 8 Bit, 63862 Hz, 79 Hz */
{ 82000000, 0, 1024, 768, 257,257,277,317,316, 769, 771, 784, 804, 804,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 1120 x 896, 8 Bit, 64000 Hz, 69 Hz */
{ 97000000, 0, 1120, 896, 281,283,306,369,368, 897, 898, 913, 938, 938,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 1152 x 910, 8 Bit, 76177 Hz, 79 Hz */
{110000000, 0, 1152, 910, 289,310,333,357,356, 911, 923, 938, 953, 953,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 1184 x 848, 8 Bit, 73529 Hz, 82 Hz */
{110000000, 0, 1184, 848, 297,319,342,370,369, 849, 852, 866, 888, 888,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* 1280 x 1024, 8 Bit, 64516 Hz, 60 Hz */
{104000000, 0, 1280,1024, 321,323,348,399,398,1025,1026,1043,1073,1073,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
/* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
--- 1220,1289 ----
* Depth, PAL, TX, TY, XY,FontX, FontY, FontData, FLo, Fhi
*/
+ #ifdef KFONT_8X11
+ #define KERNEL_FONT kernel_font_8x11
+ #define FY 11
+ #define FX 8
+ #else
+ #define KERNEL_FONT kernel_font_8x8
+ #define FY 8
+ #define FX 8
+ #endif
+
+
static struct MonDef monitor_defs[] = {
/* Text-mode definitions */
/* horizontal 31.5 kHz */
{ 50000000, 28, 640, 512, 81, 86, 93, 98, 95, 513, 513, 521, 535, 535,
! 4, RZ3StdPalette, 80, 64, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* horizontal 38kHz */
{ 75000000, 28, 768, 600, 97, 99,107,120,117, 601, 615, 625, 638, 638,
! 4, RZ3StdPalette, 96, 75, 7200, FX, FY, KERNEL_FONT, 32, 255},
/* horizontal 64kHz */
{ 50000000, 24, 768, 600, 97,104,112,122,119, 601, 606, 616, 628, 628,
! 4, RZ3StdPalette, 96, 75, 7200, FX, FY, KERNEL_FONT, 32, 255},
/* 8-bit gfx-mode definitions */
! /* IMPORTANT: the "logical" screen size can be up to 2048x2048 pixels,
! independent from the "physical" screen size. If your code does NOT
! support panning, please adjust the "logical" screen sizes below to
! match the physical ones
! */
/* 640 x 480, 8 Bit, 31862 Hz, 63 Hz */
{ 26000000, 0, 640, 480, 161,175,188,200,199, 481, 483, 491, 502, 502,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* This is the logical ^ ^ screen size */
/* 640 x 480, 8 Bit, 38366 Hz, 76 Hz */
{ 31000000, 0, 640, 480, 161,169,182,198,197, 481, 482, 490, 502, 502,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 800 x 600, 8 Bit, 38537 Hz, 61 Hz */
{ 39000000, 0, 800, 600, 201,211,227,249,248, 601, 603, 613, 628, 628,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 1024 x 768, 8 Bit, 63862 Hz, 79 Hz */
{ 82000000, 0, 1024, 768, 257,257,277,317,316, 769, 771, 784, 804, 804,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 1120 x 896, 8 Bit, 64000 Hz, 69 Hz */
{ 97000000, 0, 1120, 896, 281,283,306,369,368, 897, 898, 913, 938, 938,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 1152 x 910, 8 Bit, 76177 Hz, 79 Hz */
{110000000, 0, 1152, 910, 289,310,333,357,356, 911, 923, 938, 953, 953,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 1184 x 848, 8 Bit, 73529 Hz, 82 Hz */
{110000000, 0, 1184, 848, 297,319,342,370,369, 849, 852, 866, 888, 888,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* 1280 x 1024, 8 Bit, 64516 Hz, 60 Hz */
{104000000, 0, 1280,1024, 321,323,348,399,398,1025,1026,1043,1073,1073,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
/* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
***************
*** 1148,1152 ****
/* 1280 x 1024, 8 Bit, 75436 Hz, 70 Hz */
{121000000, 0, 1280,1024, 321,322,347,397,396,1025,1026,1043,1073,1073,
! 8, RZ3StdPalette,1280,1024, 5120, 8, 8, kernel_font_8x8, 32, 255},
--- 1292,1296 ----
/* 1280 x 1024, 8 Bit, 75436 Hz, 70 Hz */
{121000000, 0, 1280,1024, 321,322,347,397,396,1025,1026,1043,1073,1073,
! 8, RZ3StdPalette,1280,1024, 5120, FX, FY, KERNEL_FONT, 32, 255},
***************
*** 1155,1181 ****
/* 640 x 480, 16 Bit, 31795 Hz, 63 Hz */
{ 51000000, 0, 640, 480, 321,344,369,397,396, 481, 482, 490, 502, 502,
! 16, 0,1280, 1024, 7200, 8, 8, kernel_font_8x8, 32, 255},
/* 800 x 600, 16 Bit, 38500 Hz, 61 Hz */
{ 77000000, 0, 800, 600, 401,418,449,496,495, 601, 602, 612, 628, 628,
! 16, 0,1280, 1024, 7200, 8, 8, kernel_font_8x8, 32, 255},
/* 1024 x 768, 16 Bit, 42768 Hz, 53 Hz */
{110000000, 0, 1024, 768, 513,514,554,639,638, 769, 770, 783, 804, 804,
! 16, 0,1280, 1024, 7200, 8, 8, kernel_font_8x8, 32, 255},
/* 864 x 648, 16 Bit, 50369 Hz, 74 Hz */
{109000000, 0, 864, 648, 433,434,468,537,536, 649, 650, 661, 678, 678,
! 16, 0,1280, 1024, 7200, 8, 8, kernel_font_8x8, 32, 255},
! /*
! * WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
! * HAS BEEN SPECIFIED FOR. USE AT YOUR OWN RISK (AND THINK ABOUT
! * MOUNTING SOME COOLING DEVICE AT THE PROCESSOR AND RAMDAC)!
! */
/* 1024 x 768, 16 Bit, 48437 Hz, 60 Hz */
{124000000, 0, 1024, 768, 513,537,577,636,635, 769, 770, 783, 804, 804,
! 16, 0,1280, 1024, 7200, 8, 8, kernel_font_8x8, 32, 255},
};
static const char *monitor_descr[] = {
--- 1299,1353 ----
/* 640 x 480, 16 Bit, 31795 Hz, 63 Hz */
{ 51000000, 0, 640, 480, 321,344,369,397,396, 481, 482, 490, 502, 502,
! 16, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
/* 800 x 600, 16 Bit, 38500 Hz, 61 Hz */
{ 77000000, 0, 800, 600, 401,418,449,496,495, 601, 602, 612, 628, 628,
! 16, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
/* 1024 x 768, 16 Bit, 42768 Hz, 53 Hz */
{110000000, 0, 1024, 768, 513,514,554,639,638, 769, 770, 783, 804, 804,
! 16, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
/* 864 x 648, 16 Bit, 50369 Hz, 74 Hz */
{109000000, 0, 864, 648, 433,434,468,537,536, 649, 650, 661, 678, 678,
! 16, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
! /* WARNING: THE FOLLOWING MONITOR MODE EXCEEDS THE 110-MHz LIMIT THE PROCESSOR
! HAS BEEN SPECIFIED FOR. USE AT YOUR OWN RISK (AND THINK ABOUT
! MOUNTING SOME COOLING DEVICE AT THE PROCESSOR AND RAMDAC)! */
/* 1024 x 768, 16 Bit, 48437 Hz, 60 Hz */
{124000000, 0, 1024, 768, 513,537,577,636,635, 769, 770, 783, 804, 804,
! 16, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
!
! /* 24-bit gfx-mode definitions */
!
! /* 320 x 200, 24 Bit, 35060 Hz, 83 Hz d */
! { 46000000, 1, 320, 200, 241,268,287,324,323, 401, 405, 412, 418, 418,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
! /* 640 x 400, 24 Bit, 31404 Hz, 75 Hz */
! { 76000000, 0, 640, 400, 481,514,552,601,600, 401, 402, 409, 418, 418,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
! /* 724 x 482, 24 Bit, 36969 Hz, 73 Hz */
! {101000000, 0, 724, 482, 544,576,619,682,678, 483, 487, 495, 495, 504,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
! /* 800 x 600, 24 Bit, 37826 Hz, 60 Hz */
! {110000000, 0, 800, 600, 601,602,647,723,722, 601, 602, 612, 628, 628,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
! /* 800 x 600, 24 Bit, 43824 Hz, 69 Hz */
! {132000000, 0, 800, 600, 601,641,688,749,748, 601, 611, 621, 628, 628,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
!
! /*1024 x 768, 24 Bit, 32051 Hz, 79 Hz i */
! {110000000, 2, 1024, 768, 769,770,824,854,853, 385, 386, 392, 401, 401,
! 24, 0,1280, 1024, 7200, FX, FY, KERNEL_FONT, 32, 255},
};
+ #undef KERNEL_FONT
+ #undef FX
+ #undef FY
static const char *monitor_descr[] = {
***************
*** 1192,1196 ****
"GFX-8 (640x480) 31.5kHz",
"GFX-8 (640x480) 38kHz",
- "GFX-8 (800x600) 31.6kHz",
"GFX-8 (800x600) 38.5kHz",
"GFX-8 (1024x768) 64kHz",
--- 1364,1367 ----
***************
*** 1206,1209 ****
--- 1377,1387 ----
"GFX-16 (864x648) 50kHz",
"GFX-16 (1024x768) 48.5kHz ***EXCEEDS CHIP LIMIT!!!***",
+
+ "GFX-24 (320x200 d) 35kHz",
+ "GFX-24 (640x400) 31.4kHz",
+ "GFX-24 (724x482) 37kHz",
+ "GFX-24 (800x600) 38kHz",
+ "GFX-24 (800x600) 44kHz ***EXCEEDS CHIP LIMIT!!!***",
+ "GFX-24 (1024x768) 32kHz-i",
};
***************
*** 1211,1216 ****
/* patchable */
! int rh_default_mon = 0;
! int rh_default_gfx = 4;
static struct MonDef *current_mon;
--- 1389,1394 ----
/* patchable */
! int rh_default_mon = 2;
! int rh_default_gfx = 8;
static struct MonDef *current_mon;
***************
*** 1334,1338 ****
sizeof (vm->mode_descr));
vm->pixel_clock = md->FQ;
! vm->disp_width = md->MW;
vm->disp_height = md->MH;
vm->depth = md->DEP;
--- 1512,1517 ----
sizeof (vm->mode_descr));
vm->pixel_clock = md->FQ;
! vm->disp_width = (md->DEP == 4) ? md->MW : md->TX;
! vm->disp_height = (md->DEP == 4) ? md->MH : md->TY;
vm->disp_height = md->MH;
vm->depth = md->DEP;
***************
*** 1353,1360 ****
int
! rh_setvmode(gp, mode, txtonly)
struct grf_softc *gp;
unsigned mode;
! int txtonly;
{
struct MonDef *md;
--- 1532,1539 ----
int
! rh_setvmode(gp, mode, type)
struct grf_softc *gp;
unsigned mode;
! enum mode_type type;
{
struct MonDef *md;
***************
*** 1364,1368 ****
return(EINVAL);
! if (txtonly && monitor_defs[mode-1].DEP != 4)
return(EINVAL);
--- 1543,1548 ----
return(EINVAL);
! if ((type == MT_TXTONLY && monitor_defs[mode-1].DEP != 4)
! || (type == MT_GFXONLY && monitor_defs[mode-1].DEP == 4))
return(EINVAL);
***************
*** 1385,1397 ****
int a2, a3;
{
- /* implement these later... */
-
switch (cmd) {
case GM_GRFON:
! rh_setvmode (gp, rh_default_gfx + 1, 0);
return(0);
case GM_GRFOFF:
! rh_setvmode (gp, rh_default_mon + 1, 0);
return(0);
--- 1565,1575 ----
int a2, a3;
{
switch (cmd) {
case GM_GRFON:
! rh_setvmode (gp, rh_default_gfx + 1, MT_GFXONLY);
return(0);
case GM_GRFOFF:
! rh_setvmode (gp, rh_default_mon + 1, MT_TXTONLY);
return(0);
***************
*** 1403,1407 ****
case GM_GRFSETVMODE:
! return(rh_setvmode (gp, *(unsigned *) arg, 1));
case GM_GRFGETNUMVM:
--- 1581,1586 ----
case GM_GRFSETVMODE:
! return(rh_setvmode (gp, *(unsigned *) arg,
! (gp->g_flags & GF_GRFON) ? MT_GFXONLY : MT_TXTONLY));
case GM_GRFGETNUMVM:
***************
*** 1614,1617 ****
--- 1793,1797 ----
*/
+ #ifdef RZ3_64BIT_SPRITE
info->size.x = 64;
info->size.y = 64;
***************
*** 1634,1637 ****
--- 1814,1833 ----
*mp++ = (~bp20) & (bp20 & ~bp21);
}
+ #else
+ info->size.x = 32;
+ info->size.y = 32;
+ for (row = 0, hwp = (u_long *)(ba + LM_OFFSET + HWC_MEM_OFF),
+ mp = mask, imp = image;
+ row < 32;
+ row++) {
+ u_long bp10, bp11;
+ bp10 = *hwp++;
+ bp11 = *hwp++;
+ M2I (bp10);
+ M2I (bp11);
+ *imp++ = (~bp10) & bp11;
+ *mp++ = (~bp10) | (bp10 & ~bp11);
+ }
+ #endif
copyout (image, info->image, sizeof (image));
copyout (mask, info->mask, sizeof (mask));
***************
*** 1663,1670 ****
--- 1859,1873 ----
short row;
+ #ifdef RZ3_64BIT_SPRITE
if (info->size.y > 64)
info->size.y = 64;
if (info->size.x > 64)
info->size.x = 64;
+ #else
+ if (info->size.y > 32)
+ info->size.y = 32;
+ if (info->size.x > 32)
+ info->size.x = 32;
+ #endif
if (info->size.x < 32)
***************
*** 1694,1697 ****
--- 1897,1901 ----
m1 = *(unsigned long *)mp;
mp += 4;
+ #ifdef RZ3_64BIT_SPRITE
if (info->size.x > 32) {
im2 = *(unsigned long *)imp;
***************
*** 1701,1704 ****
--- 1905,1909 ----
}
else
+ #endif
im2 = m2 = 0;
***************
*** 1709,1716 ****
--- 1914,1926 ----
*hwp++ = ~m1;
+ #ifdef RZ3_64BIT_SPRITE
*hwp++ = ~m2;
+ #endif
*hwp++ = m1 & im1;
+ #ifdef RZ3_64BIT_SPRITE
*hwp++ = m2 & im2;
+ #endif
}
+ #ifdef RZ3_64BIT_SPRITE
for (; row < 64; row++) {
*hwp++ = 0xffffffff;
***************
*** 1719,1722 ****
--- 1929,1938 ----
*hwp++ = 0x00000000;
}
+ #else
+ for (; row < 32; row++) {
+ *hwp++ = 0xffffffff;
+ *hwp++ = 0x00000000;
+ }
+ #endif
free(image, M_TEMP);
***************
*** 1729,1732 ****
--- 1945,1949 ----
}
if (info->set & GRFSPRSET_ENABLE) {
+ #if 0
if (info->enable)
control = 0x85;
***************
*** 1734,1737 ****
--- 1951,1955 ----
control = 0;
WSeq(ba, SEQ_ID_CURSOR_CONTROL, control);
+ #endif
}
if (info->set & GRFSPRSET_POS)
***************
*** 1750,1755 ****
--- 1968,1978 ----
struct grf_position *pos;
{
+ #ifdef RZ3_64BIT_SPRITE
pos->x = 64;
pos->y = 64;
+ #else
+ pos->x = 32;
+ pos->y = 32;
+ #endif
return(0);
***************
*** 1763,1770 ****
{
struct MonDef *md = (struct MonDef *)gp->g_data;
! if (md->DEP < 16)
RZ3BitBlit(gp, bb);
! else
RZ3BitBlit16(gp, bb);
}
#endif /* NGRF */
--- 1986,1995 ----
{
struct MonDef *md = (struct MonDef *)gp->g_data;
! if (md->DEP <= 8)
RZ3BitBlit(gp, bb);
! else if (md->DEP <= 16)
RZ3BitBlit16(gp, bb);
+ else
+ RZ3BitBlit24(gp, bb);
}
#endif /* NGRF */
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rhreg.h sys/arch/amiga/dev/grf_rhreg.h
*** sys.orig/arch/amiga/dev/grf_rhreg.h Tue Dec 20 09:33:17 1994
--- sys/arch/amiga/dev/grf_rhreg.h Sun Dec 25 09:25:24 1994
***************
*** 16,25 ****
text-screen */
- #define MEMCLK 65000000 /* this is the memory clock value, you shouldn't
- set it to less than 65000000, higher values may
- speed up blits a little bit, if you raise this
- value too much, some trash will appear on your
- screen. */
-
#define MEMSIZE 4 /* Set this to 1 or 4 (MB), according to the
RAM on your Retina BLT Z3 board */
--- 16,19 ----
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grf_rt.c sys/arch/amiga/dev/grf_rt.c
*** sys.orig/arch/amiga/dev/grf_rt.c Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/grf_rt.c Thu Dec 22 21:13:11 1994
***************
*** 210,215 ****
/* patchable */
! int retina_default_mon = 0;
! int retina_default_gfx = 4;
#endif
--- 210,215 ----
/* patchable */
! int retina_default_mon = 2;
! int retina_default_gfx = 5;
#endif
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/grfioctl.h sys/arch/amiga/dev/grfioctl.h
*** sys.orig/arch/amiga/dev/grfioctl.h Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/grfioctl.h Sun Dec 25 07:02:51 1994
***************
*** 211,214 ****
};
! #define GRFIOCBITBLT _IOR('G', 57, struct grf_bitblt)
--- 211,214 ----
};
! #define GRFIOCBITBLT _IOW('G', 57, struct grf_bitblt)
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/ite.c sys/arch/amiga/dev/ite.c
*** sys.orig/arch/amiga/dev/ite.c Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/ite.c Thu Dec 22 21:13:11 1994
***************
*** 87,92 ****
u_int ite_confunits; /* configured units */
! int start_repeat_timeo = 30; /* first repeat after x s/100 */
! int next_repeat_timeo = 10; /* next repeat after x s/100 */
int ite_default_wrap = 1; /* you want vtxxx-nam, binpatch */
--- 87,92 ----
u_int ite_confunits; /* configured units */
! int start_repeat_timeo = 20; /* first repeat after x s/100 */
! int next_repeat_timeo = 5; /* next repeat after x s/100 */
int ite_default_wrap = 1; /* you want vtxxx-nam, binpatch */
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/par.c sys/arch/amiga/dev/par.c
*** sys.orig/arch/amiga/dev/par.c Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/par.c Thu Dec 29 04:08:57 1994
***************
*** 55,58 ****
--- 55,60 ----
#include <amiga/dev/parioctl.h>
+ /* this used to be in systm.h */
+ typedef void (*timeout_t) __P((void *));
struct par_softc {
***************
*** 62,65 ****
--- 64,69 ----
#define sc_timo sc_param.timo
#define sc_delay sc_param.delay
+ u_char *sc_buf;
+ u_int sc_buflen;
} *par_softcp;
***************
*** 154,157 ****
--- 158,165 ----
sc->sc_timo = parmstohz(PAR_TIMO);
sc->sc_delay = parmstohz(PAR_DELAY);
+
+ sc->sc_buf = (u_char*) malloc (sc->sc_burst, M_DEVBUF, M_WAITOK);
+ sc->sc_buflen = sc->sc_burst;
+
/* enable interrupts for CIAA-FLG */
ciaa.icr = CIA_ICR_IR_SC | CIA_ICR_FLG;
***************
*** 171,174 ****
--- 179,187 ----
#endif
sc->sc_flags &= ~(PARF_OPEN|PARF_OREAD|PARF_OWRITE);
+
+ free(sc->sc_buf, M_DEVBUF);
+ sc->sc_buf = 0;
+ sc->sc_buflen = 0;
+
/* don't allow interrupts for CIAA-FLG any longer */
ciaa.icr = CIA_ICR_FLG;
***************
*** 259,268 ****
#endif
buflen = min(sc->sc_burst, uio->uio_resid);
! buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK);
sc->sc_flags |= PARF_UIO;
if (sc->sc_timo > 0)
{
sc->sc_flags |= PARF_TIMO;
! timeout(partimo, (void *)unit, sc->sc_timo);
}
while (uio->uio_resid > 0)
--- 272,281 ----
#endif
buflen = min(sc->sc_burst, uio->uio_resid);
! buf = sc->sc_buf;
sc->sc_flags |= PARF_UIO;
if (sc->sc_timo > 0)
{
sc->sc_flags |= PARF_TIMO;
! timeout((timeout_t) partimo, (void *) unit, sc->sc_timo);
}
while (uio->uio_resid > 0)
***************
*** 277,289 ****
}
again:
- s = splbio();
- #if 0
- if ((sc->sc_flags & PARF_UIO) && hpibreq(&sc->sc_dq) == 0)
- sleep(sc, PRIBIO+1);
- #endif
/*
! * Check if we timed out during sleep or uiomove
*/
! (void) splsoftclock();
if ((sc->sc_flags & PARF_UIO) == 0)
{
--- 290,297 ----
}
again:
/*
! * Check if we timed out during uiomove
*/
! s = splsoftclock();
if ((sc->sc_flags & PARF_UIO) == 0)
{
***************
*** 295,299 ****
if (sc->sc_flags & PARF_TIMO)
{
! untimeout(partimo, (void *)unit);
sc->sc_flags &= ~PARF_TIMO;
}
--- 303,307 ----
if (sc->sc_flags & PARF_TIMO)
{
! untimeout((timeout_t) partimo, (void *) unit);
sc->sc_flags &= ~PARF_TIMO;
}
***************
*** 317,323 ****
s = splbio();
- #if 0
- hpibfree(&sc->sc_dq);
- #endif
#ifdef DEBUG
if (pardebug & PDB_IO)
--- 325,328 ----
***************
*** 358,366 ****
* Implement inter-read delay
*/
! if (sc->sc_delay > 0)
{
sc->sc_flags |= PARF_DELAY;
! timeout(parstart, (void *)unit, sc->sc_delay);
! error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0);
if (error)
{
--- 363,371 ----
* Implement inter-read delay
*/
! if (uio->uio_rw == UIO_READ && sc->sc_delay > 0)
{
sc->sc_flags |= PARF_DELAY;
! timeout((timeout_t) parstart, (void *) unit, sc->sc_delay);
! error = tsleep((caddr_t) sc, PCATCH|PZERO-1, "par-cdelay", 0);
if (error)
{
***************
*** 385,394 ****
if (sc->sc_flags & PARF_TIMO)
{
! untimeout(partimo, (void *)unit);
sc->sc_flags &= ~PARF_TIMO;
}
if (sc->sc_flags & PARF_DELAY)
{
! untimeout(parstart, (void *)unit);
sc->sc_flags &= ~PARF_DELAY;
}
--- 390,399 ----
if (sc->sc_flags & PARF_TIMO)
{
! untimeout((timeout_t) partimo, (void *) unit);
sc->sc_flags &= ~PARF_TIMO;
}
if (sc->sc_flags & PARF_DELAY)
{
! untimeout((timeout_t) parstart, (void *) unit);
sc->sc_flags &= ~PARF_DELAY;
}
***************
*** 406,410 ****
#endif
}
- free(buf, M_DEVBUF);
#ifdef DEBUG
if (pardebug & (PDB_FOLLOW|PDB_IO))
--- 411,414 ----
***************
*** 445,448 ****
--- 449,458 ----
pp->timo = parmstohz(upp->timo);
pp->delay = parmstohz(upp->delay);
+ if (pp->burst > sc->sc_buflen)
+ {
+ free (sc->sc_buf, M_DEVBUF);
+ sc->sc_buf = (u_char *) malloc (sc->sc_burst, M_DEVBUF, M_WAITOK);
+ sc->sc_buflen = sc->sc_burst;
+ }
break;
***************
*** 480,488 ****
}
! /* stuff below here if for interrupt driven output of data thru
the parallel port. */
int partimeout_pending;
int parsend_pending;
void
--- 490,499 ----
}
! /* stuff below here is for interrupt driven output of data thru
the parallel port. */
int partimeout_pending;
int parsend_pending;
+ u_char *parbp;
void
***************
*** 499,580 ****
printf("parintr %s\n", mask ? "FLG" : "tout");
#endif
! /*
! * if invoked from timeout handler, mask will be 0,
! * if from interrupt, it will contain the cia-icr mask,
! * which is != 0
! */
! if (mask) {
! if (partimeout_pending)
! untimeout(parintr, 0);
! if (parsend_pending)
! parsend_pending = 0;
! }
!
! /* either way, there won't be a timeout pending any longer */
partimeout_pending = 0;
!
! wakeup(parintr);
! splx(s);
}
int
! parsendch (ch)
! u_char ch;
{
! int error = 0;
! int s;
!
! /* if either offline, busy or out of paper, wait for that
! condition to clear */
! s = splclock();
! while (!error
! && (parsend_pending
! || ((ciab.pra ^ CIAB_PRA_SEL)
! & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT))))
! {
! extern int hz;
! #ifdef DEBUG
! if (pardebug & PDB_INTERRUPT)
! printf ("parsendch, port = $%x\n",
! ((ciab.pra ^ CIAB_PRA_SEL)
! & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT)));
! #endif
! /* wait a second, and try again */
! timeout(parintr, 0, hz);
! partimeout_pending = 1;
! /* this is essentially a flipflop to have us wait for the
! first character being transmitted when trying to transmit
! the second, etc. */
! parsend_pending = 0;
! /* it's quite important that a parallel putc can be
! interrupted, given the possibility to lock a printer
! in an offline condition.. */
! if (error = tsleep(parintr, PCATCH|PZERO-1, "parsendch", 0))
! {
! #ifdef DEBUG
! if (pardebug & PDB_INTERRUPT)
! printf ("parsendch interrupted, error = %d\n", error);
! #endif
! if (partimeout_pending)
! untimeout(parintr, 0);
!
! partimeout_pending = 0;
! }
! }
!
! if (! error)
! {
! #ifdef DEBUG
! if (pardebug & PDB_INTERRUPT)
! printf ("#%d", ch);
! #endif
! ciaa.prb = ch;
! parsend_pending = 1;
! }
!
! splx (s);
- return error;
}
--- 510,544 ----
printf("parintr %s\n", mask ? "FLG" : "tout");
#endif
! if (partimeout_pending)
! untimeout ((timeout_t) parintr, 0);
partimeout_pending = 0;
! splx (s);
!
! parsendch ();
}
int
! parsendch ()
{
! int s;
! s = splclock();
! /* if port is offline, wait a second, and fake a new interrupt, which
! * will take us here again. */
! if (((ciab.pra ^ CIAB_PRA_SEL)
! & (CIAB_PRA_SEL|CIAB_PRA_BUSY|CIAB_PRA_POUT))) {
! extern int hz;
! timeout ((timeout_t) parintr, 0, hz);
! partimeout_pending = 1;
! } else if (parsend_pending > 0) {
! /* transmit next character */
! ciaa.prb = *parbp++;
! parsend_pending--;
! } else {
! /* no more characters to transmit, wake up parsend() */
! wakeup ((caddr_t) parintr);
! }
! splx (s);
}
***************
*** 585,603 ****
int len;
{
! int err, orig_len = len;
! /* make sure I/O lines are setup right for output */
- /* control lines set to input */
- ciab.ddra &= ~(CIAB_PRA_SEL|CIAB_PRA_POUT|CIAB_PRA_BUSY);
- /* data lines to output */
- ciaa.ddrb = 0xff;
-
- for (; len; len--, buf++)
- if (err = parsendch (*buf))
- return err < 0 ? -EINTR : -err;
-
- /* either all or nothing.. */
- return orig_len;
}
--- 549,583 ----
int len;
{
! int err, s;
! /* guess that can't happen, right? */
! if (len <= 0)
! return -EINVAL;
!
! /* make sure I/O lines are setup right for output */
!
! /* control lines set to input */
! ciab.ddra &= ~(CIAB_PRA_SEL|CIAB_PRA_POUT|CIAB_PRA_BUSY);
! /* data lines to output */
! ciaa.ddrb = 0xff;
!
! s = spltty();
!
! /* pass buffer information to interrupt handler */
! parbp = buf;
! parsend_pending = len;
! /* send first character */
! parsendch();
! err = tsleep ((caddr_t) parintr, PCATCH|PZERO-1, "parsend", 0);
! len -= parsend_pending;
! parsend_pending = 0;
! if (partimeout_pending)
! untimeout ((timeout_t) parintr, 0);
!
! splx (s);
! if (err)
! return err < 0 ? -EINTR : -err;
! return len;
}
***************
*** 609,615 ****
int len;
{
! /* oh deary me, something's gotta be left to be implemented
! later... */
! return 0;
}
--- 589,597 ----
int len;
{
!
! /* oh deary me, something's gotta be left to be implemented
! * later... */
! return 0;
!
}
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/dev/ser.c sys/arch/amiga/dev/ser.c
*** sys.orig/arch/amiga/dev/ser.c Tue Dec 20 09:33:16 1994
--- sys/arch/amiga/dev/ser.c Wed Dec 28 23:08:42 1994
***************
*** 72,77 ****
sizeof(struct device), NULL, 0 };
#define SEROBUF_SIZE 32
! #define SERIBUF_SIZE 512
int serstart(), serparam(), serintr(), serhwiflow();
--- 72,83 ----
sizeof(struct device), NULL, 0 };
+ #ifndef SEROBUF_SIZE
#define SEROBUF_SIZE 32
! #endif
! #ifndef SERIBUF_SIZE
! #define SERIBUF_SIZE 16738
! #endif
!
! #define splser() spl5()
int serstart(), serparam(), serintr(), serhwiflow();
***************
*** 447,451 ****
sbwpt = serbuf;
++sbcnt;
! if (sbcnt > SERIBUF_SIZE - 4)
CLRRTS(ciab.pra); /* drop RTS if buffer almost full */
}
--- 453,457 ----
sbwpt = serbuf;
++sbcnt;
! if (sbcnt > SERIBUF_SIZE - 20)
CLRRTS(ciab.pra); /* drop RTS if buffer almost full */
}
***************
*** 476,480 ****
ovfl = 0;
/* lock against ser_fastint() */
! s2 = spl5();
sbcnt--;
if (sbrpt == serbuf + SERIBUF_SIZE)
--- 482,486 ----
ovfl = 0;
/* lock against ser_fastint() */
! s2 = splser();
sbcnt--;
if (sbrpt == serbuf + SERIBUF_SIZE)
***************
*** 1012,1016 ****
int c, s;
! s = splhigh();
/*
* poll
--- 1018,1022 ----
int c, s;
! s = splser();
/*
* poll
***************
*** 1038,1042 ****
int s;
! s = splhigh();
if (serconsinit == 0) {
--- 1044,1048 ----
int s;
! s = splser();
if (serconsinit == 0) {
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/cpu.h sys/arch/amiga/include/cpu.h
*** sys.orig/arch/amiga/include/cpu.h Tue Dec 20 09:33:17 1994
--- sys/arch/amiga/include/cpu.h Wed Dec 28 02:14:40 1994
***************
*** 73,77 ****
#define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
! #define CLKF_BASEPRI(framep) (((framep)->sr & PSL_IPL) == 0)
#define CLKF_PC(framep) ((framep)->pc)
#if 0
--- 73,78 ----
#define CLKF_USERMODE(framep) (((framep)->sr & PSL_S) == 0)
! /*#define CLKF_BASEPRI(framep) (((framep)->sr & PSL_IPL) == 0)*/
! #define CLKF_BASEPRI(framep) (0)
#define CLKF_PC(framep) ((framep)->pc)
#if 0
***************
*** 109,124 ****
int want_resched; /* resched() was called */
! /*
! * simulated software interrupt register
! */
! extern unsigned char ssir;
!
! #define SIR_NET 0x1
! #define SIR_CLOCK 0x2
!
! #define siroff(x) ssir &= ~(x)
! #define setsoftnet() ssir |= SIR_NET
! #define setsoftclock() ssir |= SIR_CLOCK
!
/*
--- 110,115 ----
int want_resched; /* resched() was called */
! /* include support for software interrupts */
! #include <machine/mtpr.h>
/*
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/mtpr.h sys/arch/amiga/include/mtpr.h
*** sys.orig/arch/amiga/include/mtpr.h Tue Dec 20 09:33:18 1994
--- sys/arch/amiga/include/mtpr.h Tue Dec 27 20:26:34 1994
***************
*** 46,60 ****
/*
! * simulated software interrupt register
*/
extern unsigned char ssir;
! #define SIR_NET 0x1
! #define SIR_CLOCK 0x2
#define siroff(x) ssir &= ~(x)
! #define setsoftnet() ssir |= SIR_NET
! #define setsoftclock() ssir |= SIR_CLOCK
#endif /* !_MACHINE_MPTR_H_ */
--- 46,71 ----
/*
! * simulated software interrupt register (extends hardware
! * SOFTINT bit)
*/
+ /*
+ * this makes it pretty machine dependant. Should this go into
+ * <amiga/amiga/mtpr.h> ?
+ */
+ #include <amiga/amiga/custom.h>
+
extern unsigned char ssir;
! #define SIR_NET 0x1 /* call netintr */
! #define SIR_CLOCK 0x2 /* call softclock */
! #define SIR_CBACK 0x4 /* walk the sicallback-chain */
#define siroff(x) ssir &= ~(x)
! #define setsoftint() (custom.intreq = INTF_SETCLR|INTF_SOFTINT)
! #define clrsoftint() (custom.intreq = INTF_SOFTINT)
! #define setsoftnet() (ssir |= SIR_NET, setsoftint())
! #define setsoftclock() (ssir |= SIR_CLOCK, setsoftint())
! #define setsoftcback() (ssir |= SIR_CBACK, setsoftint())
#endif /* !_MACHINE_MPTR_H_ */
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/param.h sys/arch/amiga/include/param.h
*** sys.orig/arch/amiga/include/param.h Tue Dec 20 09:33:18 1994
--- sys/arch/amiga/include/param.h Wed Dec 28 22:58:53 1994
***************
*** 152,159 ****
/*
! * spl functions; all but spl0 are done in-line
*/
#include <machine/psl.h>
#define _debug_spl(s) \
({ \
--- 152,164 ----
/*
! * spl functions; all are normally done in-line
*/
#include <machine/psl.h>
+ /*
+ * point to the custom.intenar and custom.intenaw respectively.
+ */
+ extern volatile unsigned short *amiga_intena_read, *amiga_intena_write;
+
#define _debug_spl(s) \
({ \
***************
*** 182,186 ****
#endif
! /* spl0 requires checking for software interrupts */
#define spl1() _spl(PSL_S|PSL_IPL1)
#define spl2() _spl(PSL_S|PSL_IPL2)
--- 187,191 ----
#endif
! #define spl0() _spl(PSL_S|PSL_IPL0)
#define spl1() _spl(PSL_S|PSL_IPL1)
#define spl2() _spl(PSL_S|PSL_IPL2)
***************
*** 196,211 ****
#define splbio() spl3()
#define splimp() spl3()
- /*
- * lowered to spl4 to allow for serial input into
- * private ringbuffer inspite of spltty
- */
#define spltty() spl4()
! #define splclock() spl6()
! #define splstatclock() spl6()
! #define splvm() spl6()
! #define splhigh() spl7()
! #define splsched() spl7()
! #define splx(s) (s & PSL_IPL ? _spl_no_check(s) : spl0())
#ifdef KERNEL
--- 201,212 ----
#define splbio() spl3()
#define splimp() spl3()
#define spltty() spl4()
! #define splclock() spl4()
! #define splstatclock() spl4()
! #define splvm() spl4()
! #define splhigh() spl4()
! #define splsched() spl4()
! #define splx(s) _spl_no_check(s)
#ifdef KERNEL
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/include/trap.h sys/arch/amiga/include/trap.h
*** sys.orig/arch/amiga/include/trap.h Tue Dec 20 09:33:18 1994
--- sys/arch/amiga/include/trap.h Tue Dec 27 19:44:39 1994
***************
*** 6,8 ****
--- 6,14 ----
#include <m68k/trap.h>
+ /*
+ * make sure we don't have this one defined, it's no longer done
+ * with the REI emulation.
+ */
+ #undef T_SSIR
+
#endif
diff -2Ncr -x *.o -x *~ -x *.a -x compile sys.orig/arch/amiga/stand/videomode/videomode.c sys/arch/amiga/stand/videomode/videomode.c
*** sys.orig/arch/amiga/stand/videomode/videomode.c Tue Dec 20 09:33:19 1994
--- sys/arch/amiga/stand/videomode/videomode.c Sun Dec 25 05:22:28 1994
***************
*** 4,7 ****
--- 4,8 ----
#include <sys/stat.h>
#include <sys/ioctl.h>
+ #include <sys/device.h>
#include "../../dev/grfioctl.h"
#include "../../dev/grfvar.h"